package com.lst.api.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.lst.api.vo.AssetsCreditInfoVo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.NoArgsConstructor;

import com.lst.tools.mybatis.entity.DeleteBaseModel;

/**
 * 资产信息中的信用信息
 *
 * @author Frank
 * @date 2019-12-30 10:31:37
 * @version: V1.0
 */
@Data
@NoArgsConstructor
@TableName(value = "lst_assets_credit_info")
@ApiModel(value = "资产信息中的信用信息")
public class AssetsCreditInfo extends DeleteBaseModel {

    public static final String APPLY_NO = "apply_no";
    public static final String PROMO_USER_ID = "promo_user_id";
    public static final String CREDIT_CARD_SUM = "credit_card_sum";
    public static final String CREDIT_CARD_TOTAL_QUOTA = "credit_card_total_quota";
    public static final String CREDIT_CARD_TOTAL_USE_QUOTA = "credit_card_total_use_quota";

    @ApiModelProperty(name = "applyNo", value = "申请编号", dataType = "String")
    @TableField(value = APPLY_NO)
    private String applyNo;

    @ApiModelProperty(name = "promoUserId", value = "推销员用户id", dataType = "Long")
    @TableField(value = PROMO_USER_ID)
    private Long promoUserId;

    @ApiModelProperty(name = "creditCardSum", value = "信用卡张数", dataType = "Integer")
    @TableField(value = CREDIT_CARD_SUM)
    private Integer creditCardSum;

    @ApiModelProperty(name = "creditCardTotalQuota", value = "信用卡总额度，单位元", dataType = "Double")
    @TableField(value = CREDIT_CARD_TOTAL_QUOTA)
    private Double creditCardTotalQuota;

    @ApiModelProperty(name = "creditCardTotalUseQuota", value = "信用卡已使用额度，单位元", dataType = "Double")
    @TableField(value = CREDIT_CARD_TOTAL_USE_QUOTA)
    private Double creditCardTotalUseQuota;

    public AssetsCreditInfo(long userId, String applyNo, AssetsCreditInfoVo assetsCreditInfoVo) {
        this.applyNo = applyNo;
        this.promoUserId = userId;
        this.creditCardSum = assetsCreditInfoVo.getCreditCardSum();
        this.creditCardTotalQuota = assetsCreditInfoVo.getCreditCardTotalQuota();
        this.creditCardTotalUseQuota = assetsCreditInfoVo.getCreditCardTotalUseQuota();
    }
}